
$(document).ready(function() {

    try {
        $("#dialog").dialog("destroy");
    } catch (e) {
    }

    $('#tabs').tabs();
    $("#dialog").dialog({
        autoOpen: false,
        width: $(window).width() - 5,
        height: $(window).height(),
        resizable: true,
        modal: false,
        position: 'top',
        show: {
            effect: "fade",
            duration: 500
        },
        hide: {
            effect: "fade",
            duration: 200
        },
        buttons: {
            "Salir": function() {
                $(this).dialog("close");
            },
            "Guardar": function() {
                    jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
                        jAlert('Confirmed: ' + r, 'Confirmation Results');
                    });
            }
        }
    });
    $("#dialog").dialog("open");




    $('#Envia').click(function() {
        $.ajax({
            data: {name: $('#Usuario').val()},
            url: $('#formSend').attr('action'),
            method: 'post',
            success: function(data) {
                $('#resp').html(data);
            },
            error: function(error) {
            }
        });

    });
});


